home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / DS-1.ZIP;1 / RUNTIME.ZIP / DATA.R < prev    next >
Encoding:
Text File  |  1992-02-10  |  10.0 KB  |  415 lines

  1. /*
  2.  * data.r -- Various interpreter data tables.
  3.  */
  4.  
  5. #if !COMPILER
  6.  
  7. struct b_proc Bnoproc;
  8.  
  9. /*
  10.  * External declarations for function blocks.
  11.  */
  12.  
  13. #define FncDef(p,n) extern struct b_proc Cat(B,p);
  14. #define FncDefV(p) extern struct b_proc Cat(B,p);
  15. #include "../h/fdefs.h"
  16. #undef FncDef
  17. #undef FncDefV
  18.  
  19. #define OpDef(p,n,s) extern struct b_proc Cat(B,p);
  20. #include "../h/odefs.h"
  21. #undef OpDef
  22.  
  23. extern struct b_proc Bbscan;
  24. extern struct b_proc Bescan;
  25. extern struct b_proc Bfield;
  26. extern struct b_proc Blimit;
  27. extern struct b_proc Bllist;
  28.  
  29. /* delete this Xfer */
  30.  
  31.  
  32. #ifdef TraceBack
  33.  
  34. struct b_proc *opblks[] = {
  35.     NULL,
  36. #define OpDef(p,n,s) Cat(&B,p),
  37. #include "../h/odefs.h"
  38. #undef OpDef
  39.    &Bbscan,
  40.    NULL,
  41.    NULL,
  42.    NULL,
  43.    NULL,
  44.    NULL,
  45.    NULL,
  46.    NULL,
  47.    NULL,
  48.    NULL,
  49.    NULL,
  50.    &Bescan,
  51.    NULL,
  52.    &Bfield,
  53.    NULL,
  54.    NULL,
  55.    NULL,
  56.    NULL,
  57.    NULL,
  58.    &Blimit,
  59.    &Bllist,
  60.    NULL,
  61.    NULL,
  62.    NULL
  63.    };
  64. #endif                    /* TraceBack */
  65.  
  66. /*
  67.  * Array of names and corresponding functions.
  68.  */
  69.  
  70. struct pstrnm pntab[] = {
  71.  
  72. #define FncDef(p,n) Lit(p), Cat(&B,p),
  73. #define FncDefV(p) Lit(p), Cat(&B,p),
  74. #include "../h/fdefs.h"
  75. #undef FncDef
  76. #undef FncDefV
  77.  
  78. #define OpDef(p,n,s) s, Cat(&B,p),
  79. #include "../h/odefs.h"
  80. #undef OpDef
  81.     0,         0
  82.     };
  83.  
  84. int pnsize = (sizeof(pntab) / sizeof(struct pstrnm)) - 1;
  85.  
  86. #endif                    /* COMPILER */
  87.  
  88. /*
  89.  * Structures for built-in values.  Parts of some of these structures are
  90.  *  initialized later. Since some C compilers cannot handle any partial
  91.  *  initializations, all parts are initialized later if any have to be.
  92.  */
  93.  
  94. /*
  95.  * blankcs; a cset consisting solely of ' '.
  96.  */
  97. struct b_cset  blankcs = {
  98.    T_Cset,
  99.    1,
  100. #if !EBCDIC
  101.    cset_display(0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  102. #else                    /* EBCDIC */
  103.    cset_display(0, 0, 0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  104. #endif                    /* EBCDIC */
  105.    };
  106.  
  107. /*
  108.  * lparcs; a cset consisting solely of '('.
  109.  */
  110. struct b_cset  lparcs = {
  111.    T_Cset,
  112.    1,
  113. #if !EBCDIC
  114.    cset_display(0, 0, 0400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  115. #else                    /* EBCDIC */
  116.    cset_display(0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  117. #endif                    /* EBCDIC */
  118.    };
  119.  
  120. /*
  121.  * rparcs; a cset consisting solely of ')'.
  122.  */
  123. struct b_cset  rparcs = {
  124.    T_Cset,
  125.    1,
  126. #if !EBCDIC
  127.    cset_display(0, 0, 01000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  128. #else                    /* EBCDIC */
  129.    cset_display(0, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  130. #endif                    /* EBCDIC */
  131.    };
  132.  
  133. /*
  134.  * fullcs - all 256 bits on.
  135.  */
  136. struct b_cset  fullcs = {
  137.    T_Cset,
  138.    256,
  139.    cset_display(~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  140.         ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0)
  141.    };
  142.  
  143. #if !COMPILER
  144.  
  145. /*
  146.  * Built-in csets
  147.  */
  148.  
  149. /*
  150.  * &digits; bits corrosponding to 0-9 are on.
  151.  */
  152. struct b_cset  k_digits = {
  153.    T_Cset,
  154.    10,
  155.  
  156. #if EBCDIC != 1
  157.    cset_display(0,  0,    0,  0x3ff, 0,  0, 0,  0,
  158.         0,  0,    0,  0,     0,  0,     0,  0)
  159. #else                    /* EBCDIC != 1*/
  160.    cset_display(0,  0,    0,  0,    0,  0,    0,  0,
  161.         0,  0,    0,  0,  0,  0,  0,  0x3ff)
  162. #endif                    /* EBCDIC != 1 */
  163.  
  164.    };
  165.  
  166. /*
  167.  * Cset for &lcase; bits corresponding to lowercase letters are on.
  168.  */
  169. struct b_cset  k_lcase = {
  170.    T_Cset,
  171.    26,
  172.  
  173. #if EBCDIC != 1
  174.    cset_display(0,  0,    0,  0,    0,  0,    ~01,  03777,
  175.         0,  0,    0,  0,    0,  0,    0,  0)
  176. #else                    /* EBCDIC != 1 */
  177.    cset_display(0,  0,    0,  0,    0,  0,    0,  0,
  178.         0x3fe,    0x3fe,    0x3fc,    0,  0,    0,  0,    0)
  179. #endif                    /* EBCDIC != 1 */
  180.  
  181.    };
  182.  
  183. /*
  184.  * &ucase; bits corresponding to uppercase characters are on.
  185.  */
  186. struct b_cset  k_ucase = {
  187.    T_Cset,
  188.    26,
  189.  
  190. #if EBCDIC != 1
  191.    cset_display(0,  0,    0,  0,    ~01,  03777, 0, 0,
  192.         0,  0,    0,  0,    0,  0,    0,  0)
  193. #else                    /* EBCDIC != 1 */
  194.    cset_display(0,  0,    0,  0,    0,  0,    0,  0,
  195.         0,  0,    0,  0,    0x3fe,    0x3fe,    0x3fc,    0)
  196. #endif                    /* EBCDIC != 1 */
  197.  
  198.    };
  199.  
  200. /*
  201.  * &letters; bits corresponding to letters are on.
  202.  */
  203. struct b_cset  k_letters = {
  204.    T_Cset,
  205.    52,
  206.  
  207. #if EBCDIC != 1
  208.    cset_display(0,  0,    0,  0,    ~01,  03777, ~01, 03777,
  209.         0,  0,    0,  0,    0,  0,    0,  0)
  210. #else                    /* EBCDIC != 1 */
  211.    cset_display(0,  0,    0,  0,    0,  0,    0,  0,
  212.         0x3fe,  0x3fe,    0x3fc,  0, 0x3fe, 0x3fe, 0x3fc,    0)
  213. #endif                    /* EBCDIC != 1 */
  214.  
  215.    };
  216. #endif                    /* COMPILER */
  217.  
  218. /*
  219.  * Built-in files.
  220.  */
  221.  
  222. struct b_file  k_errout = {T_File, NULL, Fs_Write};    /* &errout */
  223. struct b_file  k_input = {T_File, NULL, Fs_Read};    /* &input */
  224. struct b_file  k_output = {T_File, NULL, Fs_Write};    /* &outout */
  225.  
  226. /*
  227.  * Keyword variables.
  228.  */
  229. struct descrip kywd_err = {D_Integer};  /* &error */
  230. struct descrip kywd_pos = {D_Integer};    /* &pos */
  231. struct descrip kywd_ran = {D_Integer};    /* &random */
  232. struct descrip k_subject;         /* &subject */
  233. struct descrip kywd_trc = {D_Integer};    /* &trace */
  234.  
  235. struct descrip nullptr =
  236.    {F_Ptr | F_Nqual};                    /* descriptor with null block pointer */
  237. struct descrip trashcan;        /* descriptor that is never read */
  238.  
  239. /*
  240.  * Various constant descriptors.
  241.  */
  242.  
  243. struct descrip blank;             /* one-character blank string */
  244. struct descrip emptystr;         /* zero-length empty string */
  245. struct descrip errout = {D_File};    /* &errout */
  246. struct descrip input = {D_File};    /* &input */
  247. struct descrip lcase;            /* string of lowercase letters */
  248. struct descrip letr;            /* "r" */
  249. struct descrip nulldesc = {D_Null};    /* null value */
  250. struct descrip onedesc = {D_Integer};    /* integer 1 */
  251. struct descrip ucase;            /* string of uppercase letters */
  252. struct descrip zerodesc = {D_Integer};    /* integer 0 */
  253.  
  254. /*
  255.  * An array of all characters for use in making one-character strings.
  256.  */
  257.  
  258. char allchars[256] = {
  259.      0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
  260.     16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  261.     32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  262.     48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  263.     64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  264.     80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  265.     96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
  266.    112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
  267.    128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
  268.    144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
  269.    160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
  270.    176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
  271.    192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
  272.    208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
  273.    224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
  274.    240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
  275. };
  276.  
  277. /*
  278.  * Run-time error numbers and text.
  279.  */
  280. struct errtab errtab[] = {
  281.    101, "integer expected or out of range",
  282.    102, "numeric expected",
  283.    103, "string expected",
  284.    104, "cset expected",
  285.    105, "file expected",
  286.    106, "procedure or integer expected",
  287.    107, "record expected",
  288.    108, "list expected",
  289.    109, "string or file expected",
  290.    110, "string or list expected",
  291.    111, "variable expected",
  292.    112, "invalid type to size operation",
  293.    113, "invalid type to random operation",
  294.    114, "invalid type to subscript operation",
  295.    115, "list, set, or table expected",
  296.    116, "invalid type to element generator",
  297.    117, "missing main procedure",
  298.    118, "co-expression expected",
  299.    119, "set expected",
  300.    120, "two csets or two sets expected",
  301.    121, "function not supported",
  302.    122, "set or table expected",
  303.    123, "invalid type",
  304.    124, "table expected",
  305.    125, "list or set expected",
  306.  
  307. #ifdef EventMon
  308.    126, "improper event monitoring setup",
  309. #endif                    /* EventMon */
  310.  
  311.  
  312.    201, "division by zero",
  313.    202, "remaindering by zero",
  314.    203, "integer overflow",
  315.    204, "real overflow, underflow, or division by zero",
  316.    205, "value out of range",
  317.    206, "negative first argument to real exponentiation",
  318.    207, "invalid field name",
  319.    208, "second and third arguments to map of unequal length",
  320.    209, "invalid second argument to open",
  321.    210, "non-ascending arguments to detab/entab",
  322.    211, "by value equal to zero",
  323.    212, "attempt to read file not open for reading",
  324.    213, "attempt to write file not open for writing",
  325.    214, "input/output error",
  326.    215, "attempt to refresh &main",
  327.    216, "external function not found",
  328.  
  329.  
  330.    301, "evaluation stack overflow",
  331.    302, "system stack overflow",
  332.    303, "inadequate space for evaluation stack",
  333.  
  334. #ifdef FixedRegions
  335.    304, "inadequate space in qualifier list",
  336. #endif                    /* FixedRegions */
  337.  
  338.    305, "inadequate space for static allocation",
  339.    306, "inadequate space in string region",
  340.    307, "inadequate space in block region",
  341.    308, "system stack overflow in co-expression",
  342.  
  343. #if IntBits == 16
  344.    316, "interpreter stack too large",
  345.    318, "co-expression stack too large",
  346. #endif                    /* IntBits == 16 */
  347.  
  348. #if VMS
  349.    351, "insufficient MAXMEM limit",
  350. #endif                    /* VMS */
  351.  
  352.  
  353. #ifndef Coexpr
  354.    401, "co-expressions not implemented",
  355. #endif                    /* Coexpr */
  356.    402, "program not compiled with debugging option",
  357.  
  358.    500, "program malfunction",        /* for use by runerr() */
  359.  
  360. /*
  361.  * End of operating-system specific code.
  362.  */
  363.  
  364.    0,    ""
  365.    };
  366.  
  367. /*
  368.  * Note:  the following material is here to avoid a bug in the Cray C compiler.
  369.  */
  370.  
  371. #if !COMPILER
  372. #define OpDef(p,n,s) int Cat(O,p) Params((dptr cargp));
  373. #include "../h/odefs.h"
  374. #undef OpDef
  375.  
  376. /*
  377.  * When an opcode n has a subroutine call associated with it, the
  378.  *  nth word here is the routine to call.
  379.  */
  380.  
  381. int (*optab[])() = {
  382.     err,
  383. #define OpDef(p,n,s) Cat(O,p),
  384. #include "../h/odefs.h"
  385. #undef OpDef
  386.    Obscan,
  387.    err,
  388.    err,
  389.    err,
  390.    err,
  391.    err,
  392.    Ocreate,
  393.    err,
  394.    err,
  395.    err,
  396.    err,
  397.    Oescan,
  398.    err,
  399.    Ofield
  400.    };
  401.  
  402. /*
  403.  *  Keyword function look-up table.
  404.  */
  405. #define KDef(p) int Cat(K,p) Params((dptr cargp));
  406. #include "../h/kdefs.h"
  407. #undef KDef
  408.  
  409. int (*keytab[])() = {
  410.    err,
  411. #define KDef(p) Cat(K,p),
  412. #include "../h/kdefs.h"
  413.    };
  414. #endif                    /* !COMPILER */
  415.